package com.hxexp.weixin.test;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;

import com.hxexp.weixin.common.exception.APIException;
import com.hxexp.weixin.hpe.api.register.RegisterAPI;
import com.hxexp.weixin.hpe.api.register.model.RegisterParamBean;
import com.hxexp.weixin.hpe.api.register.model.RegisterResultBean;
import com.hxexp.weixin.test.runner.JUnit4WithSpringLogClassRunner;

/**
 * HPE用户注册接口测试
 * @author li.jiang
 *
 */
@RunWith(JUnit4WithSpringLogClassRunner.class)
@ContextConfiguration(locations={"classpath:conf/spring/spring-biz.xml", "classpath:conf/spring/spring-ehcache.xml"})
public class HPERegisterAPITester {
    @Autowired
    private RegisterAPI registerAPI;
    @Test
    public void testCase01() {
        RegisterParamBean register = new RegisterParamBean();
        register.setFullname("lijiang");
        register.setGender("1");
        register.setBirthday("1982-02-12");
        // register.setEmail("56297812@qq.com");
        register.setIdentificationType("1");
        // register.setIdentificationTypeName("身份证");
        register.setIdentificationNumber("22032219820227343X");
        register.setMobile("18067317782");
        register.setUsername("B0004");
        register.setPassengerType("adult");
        //        register.setOccupation("adult");
        //        register.setOccupationName("成人");
        register.setPassword("1234567");
        //        register.setPasswordConfirm("1234");

        try {
            RegisterResultBean result = registerAPI.register(register);
            System.out.println("注册返回结果：" + result);
        } catch (APIException e) {
            e.printStackTrace();
        }
    }
}
